Repository navigation
vapor_split: report events and v-model as bindings (0.16.0) - #6
Merged
Merged
Conversation
vapor_split wrote LiveView's conventions into its output: events became
phx-* attributes and v-model added phx-change="<name>_changed". That is
PhoenixVapor's policy, not Vize's, and it left callers no way to choose
otherwise (PhoenixVapor's hybrid mode needs no event attributes at all).
The split now leaves events and v-models unrendered and returns them as
bindings: the IR node, as vapor_ir encodes it, and the
{static_index, offset} where the element's start tag ends, so a caller
can insert its own attributes there. Binding markers go through the
same marker pass as slots, so positions stay exact across slots, and
every nested v-if and v-for split carries its own bindings.
This changes vapor_split's output and is meant for 0.16.0.
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For vize 0.16.0. This takes LiveView's conventions out of
vapor_split, so vize_ex stays a binding to Vize and PhoenixVapor owns how events are rendered.Before
vapor_splitwrote LiveView attributes into the statics:v-modelalso addedphx-change="<name>_changed", a naming convention of PhoenixVapor's. Callers couldn't opt out: PhoenixVapor's hybrid mode, where Vue in the browser handles events, still gotphx-clickattributes, which LiveView acts on until the client mounts.After
Events and
v-models are left unrendered and returned as bindings:nodeis the Vapor IR node, encoded exactly asvapor_ir/1does: aSetEventIRNode, with its modifiers, or thev-modelDirectiveIRNode.atis{static_index, byte_offset}: where the element's start tag ends, so the caller can insert attributes there without parsing HTML.v-ifandv-forsplit carries its own:bindings.Binding markers go through the same marker pass as slots, so positions are exact even when slots come before them in the same tag or static.
Breaking
vapor_split's output changes, so this is 0.16.0. PhoenixVapor is the only known consumer, and its adaptation is ready on a branch.Volt 0.19 requires
vize ~> 0.15.0. A Volt release accepting 0.16 is needed before PhoenixVapor, which requires Volt, can move to it.Verification
VIZE_EX_BUILD=1 mix cipasses: lint (includingrustq.gen --check, clippy and Dialyzer) and 122 tests. New tests cover:v-modelbindings;v-ifandv-forblocks.rustq.gen --checkalso passes underMIX_ENV=test.